import {
  useRouter
} from 'vue-router';


export default function useMessage(props) {

  const router = useRouter()


  // #region 内容跳转方法

  const jumpingComment = () => {


    // 打开新页面跳转到这个网址，并带上参数
    window.open(`http://8.134.78.60/#/postDetail/${props.list.postId}?commentId=${props.list.commentId}`, '_blank');

  }


  // #endregion



  // #region 用户名跳转方法

  const jumpingUser = () => {
    // router.push('/user/' + props.list.userId)
    window.open('http://8.134.78.60/#/user/' + props.list.userId, '_blank');

  }

  // #endregion



  // #region 帖子跳转方法

  const jumpingPost = () => {

    // window.open('http://localhost:5173/#/postDetail/' + props.list.postId, '_blank');
    window.open('http://8.134.78.60/#/postDetail/' + props.list.postId, '_blank');
  }

  // #endregion


  // #region 追评跳转方法
  const jumpingAdditionalComment = () => {
    console.log(11);

    window.open(`http://8.134.78.60/#/postDetail/${props.list.postId}?commentId=${props.list.commentId}&additionalCommentId=${props.list.additionalCommentId}`, '_blank');
  }
  // #endregion

  return {
    jumpingComment,
    jumpingUser,
    jumpingPost,
    jumpingAdditionalComment
  }

}